Sharing some naming conventions is a key point to make it possible for a team to efficiently collaborate. This rule checks that the logger field or
property name matches a provided regular expression.
The default regex will consider compliant the followings:
-
logger
-
_logger
-
Logger
-
_Logger
-
log
-
_log
The rule supports the most popular logging frameworks:
private readonly ILogger myLogger; // Noncompliant
public ILogger MyLogger { get; set; } // Noncompliant
private readonly ILogger logger; // Compliant
public ILogger Logger { get; set; } // Compliant